/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package writetoexcel;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.FileNotFoundException;
import java.util.Vector;


/**
 *
 * @author Sara Tily
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    @SuppressWarnings("empty-statement")
    public static void main(String[] args) {
        
        OutputStream out;
        
        try{
        out = new FileOutputStream("Cluster.xls");
        }
        catch(FileNotFoundException e) {
	System.out.println("Error Opening OUtput File");
	return;
	}
	
	catch(ArrayIndexOutOfBoundsException e )  {
	System.out.println("Usage : Copy File From To");
	return;
	}
         
        String sheetName = "Cluster";
        Vector featureVector1 = new Vector();
        Vector<Vector> segmentVectors = new Vector<Vector>();
        
        
        
        featureVector1.addElement("H0");
        featureVector1.addElement("S0");
        featureVector1.addElement("I0");
        featureVector1.addElement("Size /Area0");
        featureVector1.addElement("Vertical Position0");
        featureVector1.addElement("Horizontal Position0");
        
        segmentVectors.addElement(featureVector1);
        
        Vector featureVector2 = new Vector();
        featureVector2.addElement("H1");
        featureVector2.addElement("S1");
        featureVector2.addElement("I1");
        featureVector2.addElement("Size /Area1");
        featureVector2.addElement("Vertical Position1");
        featureVector2.addElement("Horizontal Position1");
        
        segmentVectors.addElement(featureVector2);
        
        Vector featureVector3 = new Vector();

        featureVector3.addElement("H2");
        featureVector3.addElement("S2");
        featureVector3.addElement("I2");
        featureVector3.addElement("Size /Area2");
        featureVector3.addElement("Vertical Position2");
        featureVector3.addElement("Horizontal Position2");
        
        segmentVectors.addElement(featureVector3);
        
        
      
        try {
        WriteToExcel writeToExcel = new WriteToExcel(out, segmentVectors, sheetName);
        System.out.println("Added");
        }
        catch(Exception e){
            System.err.print("Can't open file " + e);
        }
    }

}